// ActionScript file
package com.app.commands{
	import com.adobe.cairngorm.commands.ICommand;
	import com.adobe.cairngorm.control.CairngormEvent;
	import com.app.business.DosenDelegate;
	import com.app.control.GetInfoDosenEvent;
	import com.app.model.ModelLocator;
	import com.app.vo.DosenVO;
	
	import mx.rpc.IResponder;
	import mx.controls.Alert;
    public class GetInfoDosenCommand implements ICommand,IResponder{
        private var model:ModelLocator=ModelLocator.getInstance();
        
        public function execute(event : CairngormEvent):void{
            model.dosen.isPending=true;
            var delegate :DosenDelegate= new DosenDelegate(this);
            var getInfoDosenEvent :GetInfoDosenEvent = GetInfoDosenEvent(event);
            delegate.getInfoDosen(getInfoDosenEvent.dosenVo);
        }
        
        public function result(data:Object):void{
            model.dosen.isPending=false;
            model.dosen.dosenVo=DosenVO(data);
           // Alert.show(model.infodosen.dosenVo.dosenNama);
        }
        
        public function fault(info:Object):void{
            Alert.show( "Get Info Dosen Failed","Alert");
            model.dosen.isPending = false;
        }
        
        
    }
}
